package com.cskaoyan.controller;


import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.domain.MarketBrand;
import com.cskaoyan.service.BrandService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/wx/brand")
public class WxBrandController {
    @Autowired
    BrandService brandService;

    @GetMapping("list")
    public BaseRespVo getBrandList(int page,int limit){
        PageHelper.startPage(page,limit);
        List<MarketBrand> list = brandService.getList();
        CommonData data=CommonData.data(list);
        return BaseRespVo.ok(data);
    }

    @GetMapping("detail")
    public BaseRespVo detail(int id){
        return BaseRespVo.ok(brandService.getDetail(id));
    }


}
